package com.example.good.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseEntity {

    /**
     * 表主键
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /**
     * @desc 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreated;

    /**
     * @desc 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE,update = "now()")
    private Date gmtModified;

    /**
     * @desc 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * @desc 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String modifiedBy;

    /**
     * @desc 是否删除
     */
    @TableLogic
    @TableField("is_deleted")
    private Boolean deleted;
}
